﻿using System;

namespace AppFabricAdministrator
{
    public static class LogHelper
    {
        /// <summary>
        /// log instance
        /// </summary>
        private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

        /// <summary>
        /// Writes the info.
        /// </summary>
        /// <param name="message">The message.</param>
        public static void WriteInfo(string message)
        {
            log.Info(message);
        }

        /// <summary>
        /// Writes the exception.
        /// </summary>
        /// <param name="ex">The ex.</param>
        public static void WriteException(Exception ex)
        {
            log.Fatal("EXCEPTION", ex);
        }

        /// <summary>
        /// Writes the error.
        /// </summary>
        /// <param name="message">The message.</param>
        public static void WriteError(string message)
        {
            log.Error(message);
        }

        /// <summary>
        /// Writes the warning.
        /// </summary>
        /// <param name="message">The message.</param>
        public static void WriteWarning(string message)
        {
            log.Warn(message);
        }
    }
}
